package com.itzdm.client.fallback;

import com.itzdm.client.client.FileClient;
import com.itzdm.client.client.MessageClient;
import com.itzdm.client.domain.po.File;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.List;

/**
 * @作者：张德明
 * @时间：2025/4/6 12:53
 */
@Slf4j
public class FileFallback implements FallbackFactory<FileClient> {
    @Override
    public FileClient create(Throwable cause) {
        return new FileClient() {
            @Override
            public List<File> getFileByIds(List<Long> fileIds) {
                log.error("调用文件服务失败，原因：{}", cause.getMessage());
                return null;
            }
        };
    }
}
